package com.wuchao.utils;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author wuchao66
 * @Date 2023/10/20 15:04
 * @PackageName:com.wuchao.utils
 * @ClassName: BaseController
 * @Description: TODO
 * @Param
 * @Version 1.0
 */
public class BaseController {
    @InitBinder
    public void initBinder(WebDataBinder dataBinder){
        System.out.println("进入BaseController的initBinder方法");
        dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
    }
}
